package com.huawei.appgallery.purchasehistory.ui.activity;

import android.app.ActionBar;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.huawei.appgallery.foundation.ui.framework.activity.BaseActivity;
import com.huawei.appgallery.foundation.ui.framework.uikit.ContractFragment;
import o.ayy;
import o.azb;
import o.azc;
import o.cgv;
import o.cjk;
import o.cjm;
import o.cst.a;
import o.cst.d;
import o.cst.e;
import o.cst.h;
import o.evx;
import o.FragmentTransaction;

public class ConsumeRecordActivity extends BaseActivity {
    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        ayy.ˋ().ˎ(getWindow());
        setContentView(d.ˋ);
        getWindow().getDecorView().setBackgroundColor(getResources().getColor(a.ʼ));
        cgv.ˋ(this, a.ॱ, a.ˊ);
        azb.ˏ((RelativeLayout) findViewById(e.ॱˎ));
        ContractFragment contractFragment = (ContractFragment) cjk.ˎ().ˊ(new cjm("consumerecords.fragment", null));
        FragmentTransaction ˊ = ˏॱ().ˊ();
        ˊ.ˏ(e.ॱˎ, contractFragment, "PurchaseRecordsFragmentTag");
        ˊ.ˋ();
        ᐝ();
    }

    private void ᐝ() {
        View findViewById = findViewById(e.ॱᐝ);
        azb.ˏ(findViewById);
        ˏ(findViewById);
        ActionBar actionBar = getActionBar();
        if (azc.ˎ().ॱ() < 21) {
            ((TextView) findViewById.findViewById(e.ᐝˋ)).setText(h.ʾ);
            if (actionBar != null) {
                actionBar.hide();
            }
        } else if (actionBar != null) {
            actionBar.show();
            actionBar.setTitle(getString(h.ʾ));
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setDisplayOptions(12);
            findViewById.setVisibility(8);
        }
    }

    private void ˏ(View view) {
        view.findViewById(e.ᐧ).setOnClickListener(new evx(this) {
            final /* synthetic */ ConsumeRecordActivity ˎ;

            {
                this.ˎ = r1;
            }

            public void ˋ(View view) {
                this.ˎ.onBackPressed();
            }
        });
    }

    public boolean onOptionsItemSelected(MenuItem menuItem) {
        if (menuItem.getItemId() == 16908332) {
            onBackPressed();
        }
        return true;
    }
}
